package com.xiaodimall.beforesys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaodimall.beforesys.pojo.IndexConfig;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author wyc
 * @description
 * @ClassName IndexMsgMapper
 * @date 2022/11/25 15:40
 */
public interface IndexMsgMapper extends BaseMapper<IndexConfig> {


    //配置首页的商品展示
    @Select(" select " +
            "tb_index_config.config_id, config_name, config_type, goods_id, redirect_url, config_rank, is_deleted, create_time, create_user, update_time, update_user " +
            "from tb_index_config" +
            "        where config_type = #{configType} and is_deleted = 0" +
            "        order by config_rank desc" +
            "        limit #{number}")
    List<IndexConfig> getGoodsForIndex(int configType, int number);
}
